(function() {

    var scripts = document.getElementsByTagName('script');
    var i = 0;
    //如果网页已经使用了人人forward 则不再添加人人forward
    for (i; i < scripts.length; i++) {
        if ('http://widget.renren.com/js/forward.js' == scripts[i].src) {
            return false;
        }
    }
    var head = document.getElementsByTagName('head')[0];
    //创建和配置config的script标签
    var config = document.createElement('script');
    config.type = 'text/javascript';
    config.textContent = 'window.__fwdCfg = {"api_key" : "4cf96ce20407411a85ef01f8866b7563","img_minWidth": 260,"img_minHeight": 260,"text_minCount":15};';
    //创建和配置renren forward的script标签
    var renren = document.createElement('script');
    renren.type = 'text/javascript';
    renren.src = "http://widget.renren.com/js/forward.js";
    renren.async = "true";
    //将两个js添加到head标签中间
    head.appendChild(config);
    head.appendChild(renren);
})()